<?php
class SessionAction extends Action{
    
    public function _removeLocalSid(){
        
        //跳转指定同目录使用view设置代码为
        $this->assign('view','session');
        //跳转指定其他目录或者灵活选择全局目录使用viewfull
        //$this->assign('viewfull','/manage/page/sessiontest/session');
    }
    
    public function setLocalSid(){
        session_start();
        $_SESSION['userName']='dongheng';
        $_SESSION['userpassword']='wejriweitngjkfdgnjkfdngjkhni';
        
        echo '设置userName:'.$_SESSION['userName'];
        echo '设置userpassword:'.$_SESSION['userpassword'];
        
        //$this->assign('view','session');
    }
    
    //取得本地sessionId
    public function getLocalSid(){
        session_start();
        $this->assign('sessionId',session_id());
        $this->assign('view','session');
        var_dump($_SESSION);
    }
    
    //取得指定sessionId
    public function getAppointSid(){
        session_id(trim($_GET['sessionId']));
        session_start();
        
        $this->assign('sessionId',session_id());
        $this->assign('view','session');
    }
}
?>